/*    */ package com.newcrm.thread;
/*    */ 
/*    */ import com.newcrm.db.CompanyManager;
/*    */ import com.newcrm.manager.SyncVOIPCallRecordsManager;
/*    */ import com.newcrm.util.VOIPUtil;
/*    */ import java.io.File;
/*    */ import java.io.Serializable;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ import java.util.TimerTask;
/*    */ 
/*    */ public class DownloadVOIPFileThread extends TimerTask
/*    */   implements Serializable
/*    */ {
/*    */   private String filePath;
/*    */   private static final long serialVersionUID = -1141366473137085218L;
/*    */ 
/*    */   public DownloadVOIPFileThread(String filePath)
/*    */   {
/* 19 */     this.filePath = (filePath + File.separator + "recording");
/*    */   }
/*    */ 
/*    */   public void run()
/*    */   {
/* 29 */     File path = new File(this.filePath);
/* 30 */     if (!path.exists()) {
/* 31 */       return;
/*    */     }
/*    */ 
/* 35 */     CompanyManager manager = new CompanyManager();
/* 36 */     List companys = manager.getAllCompanys();
        for (Object companyO : companys) {
            Map company = (Map)companyO;
/* 38 */       VOIPUtil.getLogInfo(((Integer)company.get("CompanyId")).intValue());
/*    */     }
/*    */ 
/* 42 */     long startTime = System.currentTimeMillis();
/*    */ 
/* 45 */     int num = VOIPUtil.downloadFile(this.filePath);
/* 46 */     while (num > 0) {
/* 47 */       long endTime = System.currentTimeMillis();
/*    */ 
/* 50 */       if (endTime - startTime > 7200000L)
/*    */       {
/*    */         break;
/*    */       }
/* 54 */       num = VOIPUtil.downloadFile(this.filePath);
/*    */     }
/*    */ 
/* 58 */     SyncVOIPCallRecordsManager.getInstance().updateRunningStatus(false);
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.thread.DownloadVOIPFileThread
 * JD-Core Version:    0.6.1
 */